﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2020._11._19
{
   public static partial class BigClass
    {
        public static void PrintInfo(this List<int> lsl)
        {
            foreach(var item in lsl)
            {
                Console.Write(item + "");
            }
            Console.WriteLine();
        }
        public static void PrintInfo(this IEnumerable<Students> lsl)
        {
            Console.WriteLine(string.Format("Id\t名称\t年龄\t性别\t身高"));
            foreach(var item in lsl)
            {
                Console.WriteLine(string.Format("{0}\t{1}\t{2}\t{3}\t{4}", item.Id, item.Name, item.Age, item.Sex, item.Heigh));
            }
            Console.WriteLine();
        }
        public static IEnumerable<Students> SoftLiPApa(this IEnumerable<Students> ls, Func<Students, bool> func)
        {
            List<Students> newList = new List<Students>();

            foreach(var item in ls)
            {
                if (func(item))
                {
                    newList.Add(item);
                }
            }
            return newList;
        }
    }
}
